<!DOCTYPE html>
<html lang="pt-br">
  <head>
    <meta charset="utf-8">
    <title>
      {% block title %}
        {% if request.session.revenda %}
          {{ request.session.revenda.fantasia }}
        {% else %}
          Sistema de SMS da Devel
        {% endif %}
      {% endblock %}
    </title>
    <link href="/media/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="/media/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
    <style type="text/css">
      body { padding-top: 60px; padding-bottom: 40px; }
      .sidebar-nav { padding: 9px 0; }
    </style>
  </head>

  <body>
    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container-fluid">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="#">
            {% if request.session.revenda %}
              {{ request.session.revenda.fantasia }}
            {% else %}
                SMS Devel
            {% endif %}
          </a>
          <div class="nav-collapse">
            <ul class="nav">
              {% block links %}
              {% endblock %}
            </ul>
            <p class="navbar-text pull-right">
              {% if request.session.autorizado %}
                Bem vindo <b>{{ request.session.usuario.nome }}</b> | <a href="/logout">Encerrar Sess&atilde;o</a>
              {% else %}
                <a href="/usuario" class="pull-right btn btn-info"><i class="icon-user icon-white"></i> Cadastre-se</a>
              {% endif %}
            </p>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container-fluid">
      <div class="row-fluid">
        <div class="span2">
          {% if request.session.autorizado %}
          <div class="well sidebar-nav">
            <ul class="nav nav-pills nav-stacked">
              <li><a href="/">Home</a></li>
              {% block menu %}
              <li class="divider"></li>
              <li><a href="/usuarios">Usuários</a></li>
              <li><a href="/grupos">Grupos</a></li>
              {% endblock %}
            </ul>
          </div><!--/.well -->
         
        {% endif %}
        
          {% if request.session.revenda %}
            {% if request.session.revenda.logo %}
          <img src='/{{ request.session.revenda.logo }}' />
            {% endif %}
          {% else %}
            <img src='/media/logos/1.png' />
          {% endif %}

        </div><!--/span-->

        <div class="span10">

        {% if aviso %}
            <div class="alert alert-block alert-success">
            <a class="close" data-dismiss="alert">x</a>
            <h3 class="alert-heading">Aviso!</h3>
            <p>{{ aviso }}</p>
            </div>
        {% endif %}


        {% if erros %}
            <div class="alert alert-block alert-error">
            <a class="close" data-dismiss="alert">x</a>
            <h3 class="alert-heading">Aviso: Erros encontrados!</h3>
            <ul>
            {% for erro in erros %}
                <li>{{ erro }}</li>
            {% endfor %}
            </ul>
            </div>
        {% endif %}

        {% block content %}
        {% endblock %}

        </div><!--/span-->
      </div><!--/row-->

      {% if request.session.revenda %}
      <p class='well' style='text-align: right;'>
      <b>{{ request.session.revenda.fantasia }} - {{ request.session.revenda.contatos }}</b>
      </p>
      {% else %}
      <p class='well' style='text-align: right;'>
      <b> Devel Sistemas - (14) 3512-2222 </b>
      </p>
      {% endif %}

    </div><!--/.fluid-container-->
 
    <script src="/media/bootstrap/js/jquery.js"></script>
    <script src="/media/bootstrap/js/bootstrap-alert.js"></script>
    <script src="/media/bootstrap/js/bootstrap-modal.js"></script>
    <script src="/media/bootstrap/js/bootstrap-dropdown.js"></script>
    <script src="/media/bootstrap/js/bootstrap-tab.js"></script>
    <script src="/media/bootstrap/js/bootstrap-tooltip.js"></script>
    <script src="/media/bootstrap/js/bootstrap-popover.js"></script>
    <script src="/media/bootstrap/js/bootstrap-button.js"></script>
    <script src="/media/bootstrap/js/bootstrap-collapse.js"></script>
    <script src="/media/bootstrap/js/bootstrap-carousel.js"></script>
    <script src="/media/bootstrap/js/bootstrap-typeahead.js"></script>

  </body>
</html>
